package com.example.vv.controller;

import java.util.ArrayList;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author w.dehai.2024/6/7.23:07
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/demo")
public class DemoController {

    @GetMapping("/index")
    public List<String> index(Long id) {

        log.info("id: {}", id);

        for (int i = 0; i < 10; i++) {
            System.err.println(i);
        }

        List<String> resp = new ArrayList<>();
        resp.add("1");
        resp.add("2");
        return resp;
    }

    @GetMapping("/query_by_ids")
    public List<Long> queryByIds(@RequestParam List<Long> ids) {
        return ids;
    }
}
